package pagereplace;

import java.util.ArrayList;
import java.util.Random;

public class PageAddress {
	private ArrayList<Integer> address = new ArrayList<Integer>();
	private ArrayList<Integer> page = new ArrayList<Integer>();
	Random ran = new Random();

	private void createAddress() {
		int temp = 0;
		for(int i = 0; i < 200; i++) {
			if(i%2 == 0) {
				temp = ran.nextInt(199);
				address.add(temp);
				address.add(temp + 1);
			}
			else {
				temp = ran.nextInt(199) + 200;
				address.add(temp);
				if(temp == 399) {
					address.add(0);
				}
				else {
					address.add(temp + 1);
				}
			}
		}
	}
	
	private void createPage() {
		for(int in : address) {
			page.add(in/10);
		}
	}
	
	public ArrayList<Integer> getPage(){
		createAddress();
		createPage();
		return page;
	}
}
